package com.ui.activity;

import roboguice.inject.InjectView;
import android.os.Bundle;
import android.widget.ExpandableListView;

import com.core.sdk.core.BaseActivity;
import com.ui.R;
import com.ui.activity.expand.UserGroup;
import com.ui.activity.expand.UserGroupStatus;
import com.ui.activity.expand.UserInfo;
import com.ui.activity.expand.UserInfoStatus;
import com.ui.adapter.TestExpandAdapter;

public class ExpandListViewActivity extends BaseActivity {

	@InjectView(R.id.act_expand_lv)
	ExpandableListView elv;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		TestExpandAdapter adapter = new TestExpandAdapter(this);
		for (int i = 1; i <= 3; i++) {
			UserGroup ug = new UserGroup("group#"+i);
			adapter.addItemGroup(ug, new UserGroupStatus());
			for (int j = 1; j <5; j++) {
				ug.addItemChild(new UserInfo("user#"+i+"-"+j), new UserInfoStatus());
			}
		}
		elv.setAdapter(adapter);
		adapter.notifyDataSetChanged();
	}

	@Override
	protected int getContentView() {
		return R.layout.act_expand_lv;
	}

	

}
